home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga CD-Sensation: Golden Games
/
Amiga CD-Sensation - Ausgabe 2 - Golden Games (1996)(GTI - Schatztruhe)(DE)[!].iso
/
Adventurer's
/
ImpPro
/
Scripts
/
Generate.character
< prev
next >
Wrap
Text File
|
1995-06-01
|
6KB
|
274 lines
/* Random character generating script for the Character module
(C) Zach Forsyth 1995
$VER: 0.5
*/
options results
address IMPCHAR.1
/* String attributes */
NAME = 0
HEIGHT = 1
WEIGHT = 2
HAIR = 3
EYES = 4
/* Numeric attributes */
STR = 5
INT = 6
WIS = 7
DEX = 8
CON = 9
CHR = 10
PERCENT = 11
CURRHP = 12
MAXHP = 13
XPVAL = 14
BONUS = 15
LEVEL = 16
AC = 17
THAC0 = 18
MOVE = 19
AGE = 20
SAVES1 = 21
SAVES2 = 22
SAVES3 = 23
SAVES4 = 24
SAVES5 = 25
/* Cycle attributes */
CLASS = 26
RACE = 27
ALIGN = 28
SEX = 29
/* Cycle values */
CLASS_FIGHTER = 0
CLASS_THIEF = 1
CLASS_MAGE = 2
CLASS_PRIEST = 3
CLASS_DRUID = 4
CLASS_ILLUS = 5
CLASS_PALADIN = 6
CLASS_RANGER = 7
CLASS_ASSASS = 8
CLASS_MONK = 9
CLASS_BARD = 10
ALIGN_LG = 0
ALIGN_NG = 1
ALIGN_CG = 2
ALIGN_LN = 3
ALIGN_TN = 4
ALIGN_CN = 5
ALIGN_LE = 6
ALIGN_NE = 7
ALIGN_CE = 8
SEX_MALE = 0
SEX_FEMALE = 1
SEX_OTHER = 2
RACE_HUMAN = 0
RACE_ELF = 1
RACE_HALFELF = 2
RACE_DWARF = 3
RACE_HALFLING = 4
RACE_GNOME = 5
RACE_HALFORC = 6
HairStr = "Blonde Lt.Brown Brown Black Grey Red Silver"
NumHairStr = 7
EyeStr = "Brown Blue Hazel Green Grey"
NumEyeStr = 5
call random(,,time('s')) /* Seed the random # generator */
LOCKLIST /* Lock the character list against tampering */
STATUS stat /* Get status */
ADDCHAR /* The new char will already be selected */
charnum = RESULT
GETCHAR char /* Get the STEM for the character */
center = x2c(1b) || 'c'
bold = x2c(1b) || 'b'
normal = x2c(1b) || 'n'
sep = ', '
reqtitle = '"Character Generation"'
reroll = 1
do while reroll = 1
call rollstats()
reqbody = '"' || center || bold || 'STR: ' || normal || char.STR || sep || 'INT: ' || char.INT || sep || 'WIS: ' || char.WIS || sep || 'DEX: ' || char.DEX || sep || 'CON: ' || char.CON || sep || 'CHR: ' || char.CHR || '"'
reqbuttons = '"Reroll|Keep"'
REQUESTER reqbody reqbuttons
reroll = RESULT
end
reqbody = '"' || center || 'Select a race"'
reqbuttons = '"Elf|Half Elf|Dwarf|Halfling|Gnome|Human"'
REQUESTER reqbody reqbuttons
char.RACE = RESULT
reqbody = '"' || center || 'Select a sex"'
reqbuttons = '"Female|Other|Male"'
REQUESTER reqbody reqbuttons
char.SEX = RESULT
select
when char.RACE = RACE_HUMAN then do
base = 15
'ROLL 1d4'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 59
else
base = 60
'ROLL 2d10'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 100
else
base = 140
'ROLL 6d10'
char.WEIGHT =base + RESULT || " lbs"
end
when char.RACE = RACE_DWARF then do
char.CON = char.CON + 1
char.CHR = char.CHR - 1
base = 40
'ROLL 5d6'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 41
else
base = 43
'ROLL 1d10'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 105
else
base = 130
'ROLL 4d10'
char.WEIGHT =base + RESULT || " lbs"
end
when char.RACE = RACE_ELF then do
char.DEX = char.DEX + 1
char.CON = char.CON - 1
base = 100
'ROLL 5d6'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 50
else
base = 55
'ROLL 1d10'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 70
else
base = 90
'ROLL 3d10'
char.WEIGHT =base + RESULT || " lbs"
end
when char.RACE = RACE_GNOME then do
char.INT = char.INT + 1
char.WIS = char.WIS - 1
base = 60
'ROLL 3d12'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 36
else
base = 38
'ROLL 1d6'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 68
else
base = 72
'ROLL 5d4'
char.WEIGHT =base + RESULT || " lbs"
end
when char.RACE = RACE_HALFELF then do
base = 15
'ROLL 1d6'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 58
else
base = 60
'ROLL 2d6'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 85
else
base = 110
'ROLL 3d12'
char.WEIGHT =base + RESULT || " lbs"
end
when char.RACE = RACE_HALFLING then do
char.DEX = char.DEX + 1
char.STR = char.STR - 1
base = 20
'ROLL 3d4'
char.AGE = base + RESULT
if char.SEX = SEX_FEMALE then
base = 30
else
base = 32
'ROLL 2d8'
char.HEIGHT = convinches(base + RESULT)
if char.SEX = SEX_FEMALE then
base = 48
else
base = 52
'ROLL 5d4'
char.WEIGHT =base + RESULT || " lbs"
end
otherwise nop
end
char.HAIR = word(HairStr, random(1, NumHairStr))
char.EYES = word(EyeStr, random(1, NumEyeStr))
reqbody = '"' || center || 'Select a class"'
reqbuttons = '"Thief|Mage|Priest|Druid|Illusionist|Paladin|Ranger|Assassin|Monk|Bard|Fighter"'
REQUESTER reqbody reqbuttons
char.CLASS = RESULT
char.NAME = "* Generated *"
char.LEVEL = 1
char.AC = 10
PUTCHAR char
UNLOCKLIST
exit
rollstats:
char.STR = rollstat()
char.INT = rollstat()
char.DEX = rollstat()
char.WIS = rollstat()
char.CON = rollstat()
char.CHR = rollstat()
return
rollstat:
roll = 0
do 3
roll = roll + random(1, 6)
end
return roll
convinches:
inches = arg(1)
s = (inches % 12) || " ft " || (inches // 12) || " in"
return s